<template>
  <div class="item-wrapper">
    <ul>
      <router-link class="item" v-for="item in movieTopItemData.data" :to="{path: '/movie/detail/'+item._id}">
        <li>
          <img :src="item.thumb" width="160" height="100">
        <div class="item-mask"></div>
        <div class="item-title">{{item.title}}</div>
        <div class="info">
          <p class="up">up: {{item.user.name}}</p>
          <p class="play">播ss放量: {{item.see}}</p>
        </div>
      </li>
      </router-link>
    </ul>
  </div>
</template>

<script>
    export default {
      props: {
        movieTopItemData: {
          type: Object
        }
      },
    }
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="scss" rel="stylesheet/scss">
  .item-wrapper{

    .item{
      position: relative;
      overflow: hidden;
      float: left;
      cursor: pointer;
      margin-right: 20px;
      margin-bottom: 20px;
      width: 160px;
      height: 100px;
      background-image: url("../../assets/avatar.png");
      background-size: 160px 100px;
      &:nth-of-type(4){
        margin-right: 0;
      }
      &:nth-of-type(5){
        margin-bottom: 0;
      }
      &:nth-of-type(6){
        margin-bottom: 0;
      }
      &:nth-of-type(7){
        margin-bottom: 0;
      }
      &:nth-of-type(8){
        margin-bottom: 0;
        margin-right: 0;
      }
      .item-mask{
        position: absolute;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(7,17,27,0);
        transition: all 0.2s;
      }
      .item-title{
        position: absolute;
        overflow: hidden;
        top: 82px;
        left:0;
        padding: 0 5px 0 5px;
        line-height: 18px;
        text-align: center;
        width: 160px;
        max-height: 40px;
        font-size: 12px;
        color: #fff;
        background-color: rgba(7,17,27,0.2);
        transition: all 0.4s;
      }
      .info{
        opacity: 0;
        position: absolute;
        bottom: 0;
        transition: all 0.4s;
        p{
          margin-left: 5px;
          line-height: 20px;
          font-size: 12px;
          color: #99a2aa;
        }
      }
      &:hover .item-title{
        background: rgba(7,17,27,0);
      }
      &:hover .item-mask{
        background: rgba(7,17,27,0.5);
      }
      &:hover .item-title{
        top: 5px;
      }
      &:hover .info{
        opacity: 1;
      }
    }


  }
</style>
